/****** Object: View [dbo].[vw_7_2_1]   Script Date: 2014-01-19 21:48:51 ******/
USE [SHMIS];
GO
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[vw_7_2_1]'))
BEGIN
DROP VIEW [dbo].[vw_7_2_1];
END
GO

SET ANSI_NULLS ON;
GO
SET QUOTED_IDENTIFIER ON;
GO
CREATE VIEW [dbo].[vw_7_2_1]
AS
   SELECT am.Customer_Code,
          am.Contract_Num,
          am.Customer_Simple_Code,
          am.Customer_Simple_Name,
          am.[Year],
          am.[Month],
          am.Ammeter_Code,
          am.Times,
          am.Reading_Last,
          am.Reading_Curr,
          am.Actual_Reading,
          am.Final_Quantity,
          am.Avg_Quantity,
          am.Price,
          am.Avg_Index,
          am.Extra_Amount,
          am.Settlement_Amount/*,
          p.Building_Num*/
     FROM HD_AmmeterMain am/*, BI_PositionMap pm, BI_Position p*/
    WHERE     /*am.Customer_Code = pm.Customer_Code
          AND am.Contract_Num = pm.Contract_Num
          AND pm.code = p.Position_Num
          AND*/ am.Deleted = '0'
          AND am.Verified = '1'
          /*AND pm.Deleted = '0'
          AND pm.Verified = '1'
          AND p.Deleted = '0'
          AND p.Verified = '1'*/
GO

